﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DayuCode.Designer.Entity
{
    public class ProjectUser
    {
		public long? Id { get; set; }
		public long? ProjectId { get; set; }
		public string LoginId { get; set; }
		public string CreateUser { get; set; }
		public string CreateTimeStr { get; set; }
		public string RoleCode { get; set; }

        public bool IsLoginAble
        {
            get { return "1".Equals(RoleCode); }            
        }

        public bool IsAdmin
        {
            get {return "3".Equals(RoleCode); }
            set
            {
                if (value)
                {
                    RoleCode = "3";
                }
                else
                {
                    RoleCode = "1";
                }
            }
        }

        public void setRoleCode(bool loginAble, bool isAdmin)
        {
            if (isAdmin)
            {
                RoleCode = "3";
            }else if (loginAble)
            {
                RoleCode = "1";
            }
            else
            {
                RoleCode = "";
            }
        }
	}
}
